package Cau9;

import java.awt.Graphics;
 
import java.io.Serializable;

public class Oval implements Serializable {

	private static final long serialVersionUID = 1L;
	private int x;
	private int y;
	private int h;
	private int w;
	public Oval(){
		setOval(0, 0, 0, 0);
	}
	public void setOval(int x, int y,int w,int h){
		this.w = Math.abs(w);
		this.h = Math.abs(h);
		if(w<0) this.x = x + w;
		else this.x = x;
		if(h<0) this.y = y + h;
		else this.y = y;
	}
	public void drawOval(Graphics g){
		g.drawOval(x, y, w, h);
	}
	public void fillOval(Graphics g){
		g.fillOval(x, y, w, h);
	}
}
